<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2017/6/7
 * Time: 下午4:35
 */


//交换俩个值
$a = "aa";
$b = 'bb';
list($b, $a) = array($a, $b);

echo $a;
echo PHP_EOL;
echo $b;

echo PHP_EOL;

$a = [$b, $b = $a][0];
echo $a;
echo PHP_EOL;
echo $b;




//php7.1
//[$a,$b]=[$b,$a];


echo PHP_EOL;
echo strtotime("today midnight");
echo `ls`;


function callback($callback) {
    $callback();
}
$obj = (object) "php aaa";
$callback = function () use ($obj) {
    print "This is a closure use object, msg is: {$obj->scalar}. <br />";
};
$obj->scalar = "php bbb";
//$obj = (object) "php bbb";
callback($callback);

